﻿using System;
using System.Collections.Generic;
using System.ServiceProcess;
using System.Windows.Forms;

namespace ShutDownX
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main(string[] args)
        {
            if (args.Length > 0 && args[0].ToUpper() == "-SERVICE")
            {
                ServiceBase[] ServicesToRun;
                ServicesToRun = new ServiceBase[] { new ShutDownX() };
                ServiceBase.Run(ServicesToRun);
            }
            else
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new Form1());
            }
        }
    }
}
